﻿using System;
using Assist;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using YJKRevitDimensionText.DimCreator;
using YJKRevitView;

namespace YJKRevitDimensionText.Commands
{
	[Regeneration(RegenerationOption.Manual)]
	[Transaction(TransactionMode.Manual)]
	public class CmdConnectionDim : YJKCommandManual
	{
		protected override Result YJKExcute(ExternalCommandData commandData, ref string message, ElementSet elements)
		{
            CmdViewType cmdViewType = (CmdViewType)107;
			if (SwitchView.SetUsableView(cmdViewType, commandData) != Autodesk.Revit.UI.Result.Succeeded)
			{
				return Autodesk.Revit.UI.Result.Failed;
			}
			new ConnectionDimensionOperation(commandData).Excute();
			return Autodesk.Revit.UI.Result.Succeeded;
		}
	}
}
